package com.cctc.security.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.cctc.framework.dao.BaseDao;
import com.cctc.security.domain.Authoritie;
import com.cctc.security.util.SqlUtil;

@Repository
public class AuthoritieDao<T extends Authoritie> extends BaseDao<Object>
{
    
    public void addAuthoritie(T t)
    {
        save(t);
    }
    
    public void delAuthoritie(T t)
    {
        delete(t);
    }
    
    public void updateAuthoritie(T t)
    {
        update(t);
    }
    
    public T findAuthoritieById(String id)
    {
        //return findObjectById(Class<T>, id);
        return  null;
    }
    
    public List<?> getAllAuthoritieNameByUserName(String userName)
    {
        return findByNamedQuery(SqlUtil.NAME_GET_AUTHORITIE_NAME_BY_USER_ACCOUNT, userName);
    }
    
    public List<?> getAllAuthoritieName()
    {
        return findByNamedQuery(SqlUtil.NAME_GET_ALL_AUTHORITIES_NAME);
    }
}
